{% extends "base.html" %}
{% block title %}我的博客 - 登录{% endblock %}

{% block content %}
<div class="row justify-content-center">
    <div class="col-md-6">
        <h2 class="mt-4 mb-4">登录</h2>
        <form method="POST" action="{{ url_for('auth.login') }}">
            {{ form.hidden_tag() }}
            <div class="mb-3">
                {{ form.email.label(class="form-label") }}
                {{ form.email(class="form-control", placeholder="请输入邮箱") }}
                {% for error in form.email.errors %}
                <div class="text-danger">{{ error }}</div>
                {% endfor %}
            </div>
            <div class="mb-3">
                {{ form.password.label(class="form-label") }}
                {{ form.password(class="form-control", placeholder="请输入密码") }}
                {% for error in form.password.errors %}
                <div class="text-danger">{{ error }}</div>
                {% endfor %}
            </div>
            <div class="d-grid">
                {{ form.submit(class="btn btn-primary") }}
            </div>
        </form>
        <div class="mt-3 text-center">
            <p>还没有账号？<a href="{{ url_for('auth.register') }}">立即注册</a></p>
        </div>
    </div>
</div>
{% endblock %}